/**
 * 
 */
package com.ihg.hiex.entity.session.during;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author downpour
 *
 */
@Alias("SessionInBasketAnswerType")
public enum SessionInBasketAnswerType {
    
    COMMUNICATION("communication", "communication"),
    
    ACTION("action", "action"),
    
    NO_RESPONSE("no-response", "no-response"),
    
    SYSTEM_NO_RESPONSE("system-no-response", "system-no-response");

    private String description;
    
    private String alias;
    
    /**
     * 
     * @param description
     * @param alias
     */
    SessionInBasketAnswerType(String description, String alias) {
        this.description = description;
        this.alias = alias;
    }
    
    /**
     * 
     * @return
     */
    public boolean isAction() {
        return this.equals(SessionInBasketAnswerType.ACTION);
    }
    
    /**
     * 
     * @return
     */
    public boolean isCommunication() {
        return this.equals(SessionInBasketAnswerType.COMMUNICATION);
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static SessionInBasketAnswerType aliasOf(String alias) {
        for(SessionInBasketAnswerType sessionInBasketAnswerType : SessionInBasketAnswerType.values()) {
            if(StringUtils.equalsIgnoreCase(sessionInBasketAnswerType.getAlias(), alias)) {
                return sessionInBasketAnswerType;
            }
        }
        return null;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

}
